﻿<UserControl x:Class="MaxStoreShop.CoreModule.ChangePasswordDialog.ChangePasswordDialogView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:changePasswordDialog="clr-namespace:MaxStoreShop.CoreModule.ChangePasswordDialog"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:security="clr-namespace:MaxStoreErp.Core.Security;assembly=MaxStoreErp.Core"
             d:DataContext="{d:DesignInstance changePasswordDialog:ChangePasswordDialogViewModel}"
             d:DesignHeight="300"
             d:DesignWidth="300"
             MinWidth="400"
             mc:Ignorable="d">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <TextBlock VerticalAlignment="Center" Text="Введите старый пароль:" />
        <TextBlock Grid.Row="1"
                   Grid.Column="0"
                   VerticalAlignment="Center"
                   Text="Введите новый пароль:" />
        <TextBlock Grid.Row="2"
                   Grid.Column="0"
                   VerticalAlignment="Center"
                   Text="Повторите новый пароль:" />
        <PasswordBox Name="OldPasswordBox"
                     Grid.Row="0"
                     Grid.Column="1"
                     MinWidth="100"
                     Margin="6"
                     security:PasswordBoxAssistant.BindPassword="true"
                     security:PasswordBoxAssistant.BoundPassword="{Binding Path=OldPassword,
                                                                           Mode=TwoWay,
                                                                           UpdateSourceTrigger=PropertyChanged}" />
        <PasswordBox Grid.Row="1"
                     Grid.Column="1"
                     Margin="6"
                     security:PasswordBoxAssistant.BindPassword="true"
                     security:PasswordBoxAssistant.BoundPassword="{Binding Path=NewPassword,
                                                                           Mode=TwoWay,
                                                                           UpdateSourceTrigger=PropertyChanged}" />
        <PasswordBox Grid.Row="2"
                     Grid.Column="1"
                     Margin="6"
                     security:PasswordBoxAssistant.BindPassword="true"
                     security:PasswordBoxAssistant.BoundPassword="{Binding Path=ReenteredNewPassword,
                                                                           Mode=TwoWay,
                                                                           UpdateSourceTrigger=PropertyChanged}" />

        <TextBlock Grid.Row="3"
                   Grid.Column="0"
                   Grid.ColumnSpan="2"
                   FontSize="14"
                   Foreground="Red"
                   Text="{Binding ErrorText}"
                   TextAlignment="Center"
                   TextWrapping="Wrap" />
        <StackPanel Grid.Row="4"
                    Grid.Column="0"
                    Grid.ColumnSpan="2"
                    Margin="0,12,0,0"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Top"
                    Orientation="Horizontal">
            <Button Margin="0,0,6,0" IsDefault="True"
                    Command="{Binding EnterCommand}"
                    Content="OK" />
            <Button Margin="6,0,0,0" IsCancel="True"
                    Command="{Binding CancelCommand}"
                    Content="Отмена" />
        </StackPanel>
    </Grid>
</UserControl>
